#pragma once
#include <QObject>

class ScreenHelper : public QObject
{
    Q_OBJECT

public:
    explicit ScreenHelper(QObject *parent = nullptr);

    static ScreenHelper* GetInstance();

    //Screen
    Q_INVOKABLE qreal dp2px(const qreal &size);

    Q_INVOKABLE qreal px2dp(const qreal &px);

    //font
    Q_INVOKABLE qreal px2pt(const qreal &px);

    Q_INVOKABLE qreal pt2px(const qreal &pt);

    Q_INVOKABLE qreal sp2pt(const qreal &sp);

    Q_INVOKABLE qreal sp2px(const qreal &sp);

private:
    qreal ppi;
    qreal lpi;
private:
    static ScreenHelper * instance;
};
